using System;
using RollManager.Library;
using System.Windows.Forms;

namespace RollManager.Forms.MenuDialogs
{
    public partial class RenameServerDialog : Form
    {
        private Server m_server;

        public RenameServerDialog( Server server )
        {
            m_server = server;
            InitializeComponent();

            nameBox.Text = m_server.Name;
        }

        private void okButton_Click( object sender, EventArgs e )
        {
            Database.RenameServer( m_server.Id, nameBox.Text );
            DialogResult = DialogResult.OK;
            Close();
        }

        private void cancelButton_Click( object sender, EventArgs e )
        {
            DialogResult = DialogResult.Cancel;
            Close();
        }
    }
}